﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<HuynhQuangWebsite.Models.Service>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="TitleAreaPlaceHolder" runat="server">
<div class="pageTitle">
        <h5>Quản lý trang mục dịch vụ</h5>
        <span>Trang quản lý thêm mới nội dung về các dịch vụ do công ty cung cấp</span>
    </div>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">

    <%using (Html.BeginForm("Create", "ManageService", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form", id = "validate" }))
    { %>
    <fieldset>
        <div class="widget">
            <div class="title"><img src="../../Images/adminSite/icons/dark/pencil.png" alt="" class="titleIcon" /><h6>Thông tin chi tiết về dịch vụ</h6></div>
            <%--<div class="formRow">
                <label>Hình đại diện:<span class="req">*</span></label>
                <div class="formRight"><img src="<%=Model.ServiceImgThumb %>" alt="<%=Model.ServiceName %>"/></div>
                <div class="clear"></div>
            </div>--%>
            <div class="formRow">
                <label>Tải hình:<span class="req">*</span></label>
                <div class="formRight"><input type="file" id="uploadImg" name="uploadFile" /></div>
                <div class="clear"></div>
            </div>
            <div class="formRow">
                <label>Tên Dịch vụ:<span class="req">*</span></label>
                <div class="formRight"><%:Html.TextBoxFor(model => model.ServiceName, new { @class = "validate[required]", id = "req" })%></div>
                <div class="clear"></div>
            </div>
            <div class="formRow">
                <label>Thông tin về dịch vụ:<span class="req">*</span></label>
                <div class="formRight"><%:Html.TextAreaFor(model => model.ServiceDetails, new { @class = "autoGrow", id = "textareaServiceDetail", rows = "8", cols = "" })%></div>
                <div class="clear"></div>
            </div>
            <div class="formRow">
                <label>Diễn giải:<span class="req">*</span></label>
                <div class="formRight"><%:Html.TextAreaFor(model => model.ServiceDesc, new { @class = "autoGrow", id = "textareaServiceDesc", rows = "8", cols = "" })%></div>
                <div class="clear"></div>
            </div>
            <div class="formRow">
                <div class="formRight">
                    <%=Html.CheckBoxFor(mode => mode.ServiceIsVisible)%><label for="checkVisible">Cho phép hiển thị</label>
                    <%=Html.CheckBoxFor(model => model.ServiceIsTypical)%><label for="checkTypical">Nỗi bật</label>
                </div>
                <div class="clear"></div>
            </div>
            <div class="formSubmit"><input type="submit" value="cập nhật" class="blueB" /></div>
        <%}%>
        <%using (Html.BeginForm("Delete", "ManageService", new { id = Model.ServiceID }, FormMethod.Post, new { enctype = "multipart/form-data", @class = "form", id = "validate" }))
        { %>
            <div class="formSubmit"><input type="submit" value="Xóa" class="redB" /></div>
            <div class="clear"></div>
            <div><%:Html.HiddenFor(model => model.ServiceID)%></div>
        <%} %>
            <div class="clear"></div>
        </div>
        <div class="nNote nSuccess hideit">
            <p><strong>THÀNH CÔNG: </strong>Cập nhật thông tin thuộc tính thành công!!!!</p>
        </div>
        <div class="widget">
            <div class="title"><span class="titleIcon"><input type="checkbox" id="titleCheck" name="titleCheck" /></span>
                <h6>Danh sách thuộc tính</h6>
                <div style="float:right"><a href="<%=Url.Action("CreateAttribute","ManageService", new {fk = Model.ServiceID}) %>" title="" class="button greyishB" style="margin: 5px;"><img src="../../Images/adminSite/icons/light/create.png" alt="" class="icon" /><span>Thêm mới thuộc tính</span></a></div>
            </div>
            <table cellpadding="0" cellspacing="0" width="100%" class="sTable withCheck mTable" id="checkAll">
                <thead>
                    <tr>
                        <td><img src="../../Images/adminSite/icons/tableArrows.png" alt="" /></td>
                        <td style="width:10%">Thuộc tính</td>
                        <td>Chức năng</td>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <td colspan="6">
                            <div class="itemActions">
                                <label>Chức năng:</label>
                                <select>
                                    <option value="">Chọn chức năng...</option>
                                    <option value="Edit">Sửa</option>
                                    <option value="Delete">Xóa</option>
                                    <option value="Move">di chuyển</option>
                                </select>
                            </div>
                            <div class="tPagination">
                                <ul>
                                    <li class="prev"><a href="#" title=""></a></li>
                                    <li><a href="#" title="">1</a></li>
                                    <li><a href="#" title="">2</a></li>
                                    <li><a href="#" title="">3</a></li>
                                    <li><a href="#" title="">4</a></li>
                                    <li><a href="#" title="">5</a></li>
                                    <li><a href="#" title="">6</a></li>
                                    <li>...</li>
                                    <li><a href="#" title="">20</a></li>
                                    <li class="next"><a href="#" title=""></a></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                </tfoot>
                <tbody>
                <%
                HuynhQuangWebsite.Models.huynhquangco_websiteEntities ctx = new HuynhQuangWebsite.Models.huynhquangco_websiteEntities();
                HuynhQuangWebsite.Models.HomeAdminListViewModel AdminModel = new HuynhQuangWebsite.Models.HomeAdminListViewModel();
                AdminModel.ServiceAttributeList = (from attributes in ctx.ServiceAttributes where attributes.FK_ServiceID == Model.ServiceID select attributes).ToList();
                if (AdminModel.ServiceAttributeList != null)
                {
                    int CountId = 0;
                    foreach (var itemAttributes in AdminModel.ServiceAttributeList)
                    {
                        CountId++;%>      
                        <tr>
                            <td><input type="checkbox" id="titleCheck2" name="checkRow" /></td>
                            <td style="width:85%; margin-right:20px"><div style="display:none"><%=CountId %></div><div class="formRow"><%=Html.TextBox("ServiceAttributeName", itemAttributes.ServiceAttributeName, new { @class = "validate[required]", id = "name"+CountId })%></div></td>
                            <td class="actBtns">
                                <a href="#Cập nhật thuộc tính" title="Update" class="tipS" id="txtUpdateAttribute" onclick="UpdateServiceAttribute(<%=itemAttributes.ServiceAttributeID %>,<%=itemAttributes.FK_ServiceID %>, <%=CountId %>)">
                                    <img src="../../Images/adminSite/icons/dark/pencil.png" alt="" /></a>
                                <a href="<%=Url.Action("DeleteFromAttribute", "ManageService", new {id = itemAttributes.ServiceAttributeID}) %>" title="Remove" class="tipS">
                                    <img src="../../Images/adminSite/icons/dark/close.png" alt="" /></a>
                            </td>
                        </tr>
                    <%}%>
                </tbody>
            </table>
        </div>     
    </fieldset>
<%}%>

</asp:Content>


